package com.firewolf.controller;

import com.firewolf.log.core.OperationLog;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 作者：刘兴
 * 时间:19/2/20
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @GetMapping
    @OperationLog(opreate = "Hello方法")
    public String hello(String name, Integer age, HttpSession session,HttpServletResponse response) {
        response.setStatus(HttpStatus.OK.value());
        session.setAttribute("user", name);
        return "hello," + name + "," + age;
    }


    @GetMapping("/a")
    public String hello2() {
        return "hello2";
    }
}
